package mutsumimod.cards.stand;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.actions.RipperAction;
import mutsumimod.actions.TriggerStandAction;
import mutsumimod.actions.TrueDamageCallbackAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.powers.BreakPower;
import mutsumimod.util.CardStats;
import mutsumimod.util.tags.CustomTags;

public class Ripper extends BaseCard {
    public static final String ID = makeID(Ripper.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.UNCOMMON,
            CardTarget.ENEMY,
            1
    );

    public Ripper() {
        super(ID, info);
        this.damage = this.baseDamage = 16;
        standTag=7;
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        stand(standTag,m);
        //this.addToBot(new TriggerStandAction(7, new RipperAction(m, new DamageInfo(p, this.damage))));
    }

    @Override
    public void standUse7(AbstractPlayer p, AbstractMonster m) {
        addToTop(new TrueDamageCallbackAction(m, new DamageInfo(AbstractDungeon.player
                , damage, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.SLASH_VERTICAL,
                (dmg) -> {
                    addToTop(new ApplyPowerAction(m,p,new BreakPower(m,dmg),dmg));
                }
        ));
    }

    @Override
    public void upgrade() {
        if (!upgraded) {
            this.upgradeName();
            this.upgradeDamage(5);
        }
    }
}
